package com.badger.spring.cloud.alibaba.consumer.api;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import com.badger.spring.cloud.alibaba.consumer.api.dto.SeataProviderDto;
import com.badger.spring.cloud.alibaba.consumer.config.FeignConfig;

/**
 * feign接口 指定调用哪个接口 
 * 注解：@FeignClient 标注为feign接口 value 指向调用的模块名
 * spring boot 2.0 只有一个服务端（value = "同一个名字"），只能写一个注解,
 * 可以使用contextId 作为区分,而写多个@FeignClient
 * @author liqi ,
 */
@FeignClient(value = "seata-provider")
public interface ProviderFeignApi {

    @PostMapping("/provider/save")
    void saveEntity(@RequestBody SeataProviderDto dto);

    @PostMapping("/provider/ex")
    void saveEx(@RequestBody SeataProviderDto dto);

    @PostMapping("/provider/timeout")
    void saveEntityTimeOut(@RequestBody SeataProviderDto entity);
}
